/**
 * Licensed to Open-Ones Group under one or more contributor license
 * agreements. See the NOTICE file distributed with this work
 * for additional information regarding copyright ownership.
 * Open-Ones Group licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a
 * copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package openones.ipresenter.android.dao;

import java.net.Socket;
import android.app.Application;
import android.bluetooth.BluetoothSocket;

/**
 * This class hold information about BluetoothSocket and WifiSocket.
 * It exists as a single instance across the application.
 * @author OOG member
 */
public class ConnectionData extends Application {
    
    /**
     * BluetoothSocket is not parcelable, so it cannot be transfered through Intent.
     * mBluetoothSocket is received in ScanBluetoothActivity and is used in PresentActivity.
     */
    private BluetoothSocket mBluetoothSocket;
    
    /**
     * mWifiSocket is received in ScanWifiActivity and is used in PresentActivity.
     */
    private Socket mWifiSocket;
    
    /**
     * Get mBluetoothSocket.
     * @return mBluetoothSocket
     */
    public BluetoothSocket getBluetoothSocket() {
        return mBluetoothSocket;
    }
    
    /**
     * Set mBluetoothSocket.
     * @param aBluetoothSocket The BluetoothSocket to set.
     */
    public void setBluetoothSocket(BluetoothSocket aBluetoothSocket) {
        mBluetoothSocket = aBluetoothSocket;
        }
    
    /**
     * Get mWifiSocket.
     * @return mWifiSocket.
     */
    public Socket getWifiSocket() {
        return mWifiSocket;
    }
    
    /**
     * Set mWifiSocket.
     * @param aWifiSocket The WifiSocket to set/
     */
    public void setWifiSocket(Socket aWifiSocket) {
        mWifiSocket = aWifiSocket;
    }
    
    /**
     * Call when ConnectionData is created.
     */
    @Override
    public void onCreate() {
        mBluetoothSocket = null;
    }
}
